1. Field of the Invention
The invention relates to an improved data receiving system applied to the case where a device receives data from an external device, as, for example, a terminal printer which receives data from a host computer.
2. Description of Related Art
In the case where a terminal printer or the like receives data from a host computer, a handshake procedure such as shown in FIG. 1 is generally performed between both devices.
In FIG. 1, the host computer (hereinafter referred to as the "host") transmits data (hereinafter referred to as "DATA") to the printer, e.g., by the byte. In addition, during the transmission of each DATA, the printer is informed that effective data transmission is taking place by a data strobe signal (hereinafter referred to as "DSTB") which is caused to go low for a predetermined period of time.
The printer receives DATA in response to the fall of DSTB. After the reception of DATA, the printer causes a busy signal (hereinafter referred to as "BUSY") to go high to give the host an indication that the printer is not yet ready to receive next DATA. The host stands by instead of transmitting the next DATA while BUSY is high.
When ready to receive the next DATA, the printer not only gives the host an indication that the printer acknowledges reception of DATA by causing an acknowledge signal (hereinafter referred to as "ACK") to go low for a predetermined period of time, but also informs the host that the printer is now ready to receive DATA by causing BUSY to go low. In response thereto, the host begins transmitting the next DATA, and causes DSTB to go low for a predetermined period of time. The aforementioned operations are repeated until the last DATA is transmitted.
In the aforementioned handshake procedure, there are two systems for causing the host to recognize that the printer is ready to receive DATA. One system is, as described above, that in which the host refers to both ACK and BUSY sent from the printer. The other system is that in which the host refers only to BUSY. No matter which system the host opts, normal handshaking is established as long as the printer outputs both ACK and BUSY.
However, if the host refers only to BUSY, it is better to cause the printer to match the system opted by the host. That is, it is better to design the system so that the printer can receive DATA from the host as soon as possible by immediately causing BUSY to go low without outputting ACK as long as the printer is ready to receive DATA. This system eliminates waste of time, thereby contributing to freeing the host at an early stage of processing.
Thus, the system that has heretofore been used is that ACK or BUSY can be manually selected on the printer side so as to match the system of the host. However, such selection is not only cumbersome but also so highly technical for the user, that many users, in reality, operate the printer based on the system of outputting both ACK and BUSY which are defaults. As a result, with respect to the host that refers only to BUSY, the printer occupies the host for a longer time than necessary.
Further, the printer, while executing the aforementioned handshake procedure with respect to the host, stores received DATA in a receiving buffer contained therein and sequentially takes out DATA within the receiving buffer concurrently therewith. If the receiving buffer is kept full with the processing of DATA within the printer being behind the transmission of DATA from the host during this process, the printer maintains BUSY high until an empty space is available in the receiving buffer, which in turn keeps the host waiting until subsequent DATA can be transmitted.
To avoid this inconvenience, it is desired that the printer has a receiving buffer whose capacity is suited for printer speed, transmission speed by the host, and the total volume of DATA. To meet this requirement, conventional printers are designed to manually set the capacity of the receiving buffer.
However, the aforementioned problem is encountered if the capacity of the receiving buffer is too small, and memory areas within the printer for other processing become eroded if the capacity of the receiving buffer is too large. Therefore, to determine an appropriate capacity is too difficult a task for the user. Thus, many users accept the default capacity of the receiving buffer, which in turn keeps the host waiting for a longer time than necessary.